﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FishShadow : MonoBehaviour
{
    public Vector3 delta;
    public Animator am;
    public Animator paAm;
    public Transform pa;
    // Use this for initialization
    void Start()
    {
        delta = new Vector3(0.17f, 0f, -1f);
        pa = transform.parent;
    }

    // Update is called once per frame
    void Update()
    {
        if(paAm==null)
        {
            Destroy(gameObject);
            return;
        }
        am.speed = paAm.speed;
        transform.rotation = pa.transform.rotation;
        transform.position = pa.transform.position + delta;
    }
}
